package com.xiguanlezz.cn.api.naming;


import com.xiguanlezz.cn.api.naming.listener.EventListener;
import com.xiguanlezz.cn.api.naming.pojo.Instance;

import java.util.List;

/**
 * @Author：习惯了种种
 * @CreateDate：2024/11/16 16:02
 * @Description：服务注册/发现接口
 */
public interface NamingService {
    void registerInstance(String serviceName, String ip, int port) throws Exception;

    void registerInstance(String serviceName, String groupName, String ip, int port) throws Exception;

    void registerInstance(String serviceName, Instance instance) throws Exception;

    void registerInstance(String serviceName, String groupName, Instance instance) throws Exception;

    void deregisterInstance(String serviceName, String ip, int port) throws Exception;

    void deregisterInstance(String serviceName, String groupName, String ip, int port) throws Exception;

    void deregisterInstance(String serviceName, Instance instance) throws Exception;

    void deregisterInstance(String serviceName, String groupName, Instance instance) throws Exception;

    void subscribe(String serviceName, EventListener listener) throws Exception;

    void subscribe(String serviceName, String groupName, EventListener listener) throws Exception;

    void subscribe(String serviceName, List<String> clusters, EventListener listener) throws Exception;

    void subscribe(String serviceName, String groupName, List<String> clusters, EventListener listener) throws Exception;

    void unsubscribe(String serviceName, EventListener listener) throws Exception;

    void unsubscribe(String serviceName, String groupName, EventListener listener) throws Exception;

    void unsubscribe(String serviceName, List<String> clusters, EventListener listener) throws Exception;

    void unsubscribe(String serviceName, String groupName, List<String> clusters, EventListener listener) throws Exception;


}
